import {defineStore} from 'pinia'

export const useStore = defineStore({
  id: 'index',
  state: () => ({
    speed: 100
  }),
  persist: {
    key: 'pinia-store',
    storage: sessionStorage
  },
  getters: {
    doubleCount: (state) => {
      return state.speed * 2
    }
  },
  actions: {
    increment(a: number) {
      this.speed += a
    }
  }
})
